package com.andy.eqm.server.client;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.andy.eqm.server.socket.codec.DataWrap;
import com.google.common.collect.Lists;

import io.netty.channel.ChannelHandlerContext;

public class ClientRobot {
	
	private static Logger logger = LoggerFactory.getLogger(ClientRobot.class);
	
	public static int userId;
	public static String userName;
	public static String nickName;
	public static long coin;
	public static int desk;
	public static int deskIndex;
	public static int battery;
	public static int rate;
	
	public static List<Integer> fishs = Lists.newArrayList();
	
	static int scriptId;

	public static void action100(ChannelHandlerContext ctx, DataWrap dataWrap) {
		userId = dataWrap.getInt();
		String userName = dataWrap.getString();
		logger.info("userId:{},userName:{}",userId,userName);
		coin = dataWrap.getLong();
		nickName = dataWrap.getString();
		dataWrap.getInt();
		int size = dataWrap.getInt();
		
		for(int i=0;i<size;i++){
			int itemId = dataWrap.getInt();
			int count = dataWrap.getInt();
			logger.info("itemId:{}=>{}",itemId,count);
		}
	}

	public static void action110(ChannelHandlerContext ctx, DataWrap dataWrap) {
		int len = dataWrap.getInt();
		for(int i=0;i<len;i++){
			int itemId = dataWrap.getInt();
			int count = dataWrap.getInt();
			logger.info("item:{}=>{}",itemId,count);
		}
	}

	public static void action112(ChannelHandlerContext ctx, DataWrap dataWrap) {
		logger.info("有玩家加入：{}-{}",dataWrap.getByte(),dataWrap.getInt());
	}
	
	public static void action118(ChannelHandlerContext ctx, DataWrap dataWrap) {
		logger.info("玩家退出游戏：{}",dataWrap.getInt());
		
	}


	
	
}
